<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key={{=googlemapkey}}" type="text/javascript"></script>
<script type="text/javascript">
    //<![CDATA[
    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(0,0), 1);
        // Create a base icon for all of our markers that specifies the
        // shadow, icon dimensions, etc.
        var blueIcon = new GIcon();
        blueIcon.image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png";
        blueIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
        blueIcon.iconSize = new GSize(37, 34);
        blueIcon.shadowSize = new GSize(37, 34);
        blueIcon.iconAnchor = new GPoint(9, 34);
        blueIcon.infoWindowAnchor = new GPoint(9, 2);
        blueIcon.infoShadowAnchor = new GPoint(18, 14);
        function createMarker(point, i, message) {
           // Set up our GMarkerOptions object
           if(i==0) markerOptions = { icon:blueIcon };
           else markerOptions= {}
           var marker = new GMarker(point, markerOptions);
           GEvent.addListener(marker, "click", function() {
             marker.openInfoWindowHtml(message);
           });
           return marker;
        }
        {{for row in rows:}}{{if row.latitude and row.longitude:}}
          var point = new GLatLng({{=row.latitude}},{{=row.longitude}});
          map.addOverlay(createMarker(point, 0, "{{=(row.map_popup or '...').replace('"',"'")}}"));
        {{pass}}{{pass}}
     }
    }
    //]]>
</script>
<div id="map" style="width: {{=width}}; height: {{=height}}"></div>
<script>load();</script>


